﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CanDoo.Core;
using CanDoo.Data;
using CanDoo.Contracts;
using CanDoo.Oil.Core.Models;
using CanDoo.Oil.Core.DTOs;
using CanDoo.Core.Data;

namespace CanDoo.Oil.Core.Contracts
{
    /// <summary>
    /// 业务契约——应付账单
    /// </summary>
    public interface IBuyBillContract : IServiceBaseCore<BuyBill>, IServiceBase<BuyBill>
    {
        /// <summary>
        /// 生成新单据号
        /// </summary>
        /// <returns></returns>
        string GetNewCode();

        /// <summary>
        /// 审核通过时 自动创建采购入库应付单
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>

        OperationResult CreateBill(InStore m);

        /// <summary>
        /// 审核通过时 自动创建采购退货应付单
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        OperationResult CreateBill(InBuyBack m);

        /// <summary>
        /// 撤销审核时 删除自动创建的入库单
        /// </summary>
        /// <param name="linkEntityId"></param>
        /// <returns></returns>
        OperationResult DeleteBill(long linkEntityId);

        /// <summary>
        /// 数据转换为列表显示的格式
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        StatementDetailItem EntityChange(BuyBill m);
    }
}

